<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

<h:head>
    <title>三一 - 问卷调查</title>
    <link href="../../css/component.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="../../js/highcharts.js"></script>
    <script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
    <ui:param name="bean" value="#{adDayAllReportDetailAction}"/>

    <span class="pagetitle">市场数据分析 —— 广告日数据</span>
    <p:separator/>

    <!-- 右侧页面顶部查询部分 -->
    <h:form id="fsearch">
        <h:outputLabel id="radioHide" value="#{bean.dateRadio}" style="visibility: hidden"/>

        <p:outputPanel id="customPanel" style="margin-bottom:10px">
            <p:selectOneRadio id="customRadio" value="#{bean.dateRadio}" layout="custom">
                <f:selectItem itemLabel="1" itemValue="1"/>
                <f:selectItem itemLabel="7" itemValue="7"/>
                <f:selectItem itemLabel="15" itemValue="15"/>
                <f:selectItem itemLabel="30" itemValue="30"/>
                <f:selectItem itemLabel="0" itemValue="0"/>
            </p:selectOneRadio>

            <h:panelGrid id="opt" columns="20" cellpadding="8">
                <p:radioButton id="opt5" for="customRadio" itemIndex="0"/>
                <h:outputLabel for="opt5" value="昨天"/>
                <h:outputLabel/>

                <p:radioButton id="opt1" for="customRadio" itemIndex="1"/>
                <h:outputLabel for="opt1" value="近7天"/>
                <h:outputLabel/>

                <p:radioButton id="opt2" for="customRadio" itemIndex="2"/>
                <h:outputLabel for="opt2" value="近15天"/>
                <h:outputLabel/>

                <p:radioButton id="opt3" for="customRadio" itemIndex="3"/>
                <h:outputLabel for="opt3" value="近30天"/>
                <h:outputLabel/>

                <p:radioButton id="opt4" for="customRadio" itemIndex="4"/>
                <h:outputLabel for="opt4" value="自定义 开始时间"/>
                <p:calendar value="#{bean.dateStart}" mode="popup" pattern="yyyy-MM-dd">
                </p:calendar>
                <h:outputLabel for="opt4" value="结束时间"/>
                <p:calendar value="#{bean.dateEnd}" mode="popup" pattern="yyyy-MM-dd">
                </p:calendar>
            </h:panelGrid>
            <h:panelGrid columns="9">
                <p:selectCheckboxMenu id="menuAffiliation" value="#{bean.selectedAffiliation}" label="归属"
                                      filter="true" filterMatchMode="startsWith" style="width:150px">
                    <f:selectItems value="#{bean.affiliation}"/>
                </p:selectCheckboxMenu>
                <p:selectCheckboxMenu id="menuChannelName" value="#{bean.selectedChannelName}" label="渠道名称"
                                      filter="true" filterMatchMode="startsWith" style="width:150px">
                    <f:selectItems value="#{bean.channelName}"/>
                </p:selectCheckboxMenu>
                <p:selectCheckboxMenu id="menuAgent" value="#{bean.selectedAgent}" label="代理商"
                                      filter="true" filterMatchMode="startsWith" style="width:150px">
                    <f:selectItems value="#{bean.agent}"/>
                </p:selectCheckboxMenu>
                <p:selectCheckboxMenu id="menuPlatform" value="#{bean.selectedPlatform}" label="平台"
                                      filter="true" filterMatchMode="startsWith" style="width:150px">
                    <f:selectItems value="#{bean.platform}"/>
                </p:selectCheckboxMenu>
                <p:selectCheckboxMenu id="menuPaytype" value="#{bean.selectedPaytype}" label="结算方式"
                                      filter="true" filterMatchMode="startsWith" style="width:150px">
                    <f:selectItems value="#{bean.paytype}"/>
                </p:selectCheckboxMenu>
                <p:selectCheckboxMenu id="menuAdvPosition" value="#{bean.selectedAdvPosition}" label="广告位置"
                                      filter="true" filterMatchMode="startsWith" style="width:150px">
                    <f:selectItems value="#{bean.advPosition}"/>
                </p:selectCheckboxMenu>
                <p:commandButton id="ajax" value="查询" update=":#{p:component('dform')} :fsearch"
                                 action="#{bean.search()}"/>
            </h:panelGrid>
        </p:outputPanel>

        <p:growl id="growl" showDetail="true" sticky="true"/>
    </h:form>
    <br/>

    <!-- 数据展示部分，包含表格和图表 -->
    <h:form id="dform">
        <h:panelGrid columns="1" style="width:100%">
            <div id="basewidth" style="width:92%;height:0; border:0;"/>
        </h:panelGrid>
        <div class="data" id="data">
            <p:panel id="panel" header="详细数据" style="margin-bottom:10px;">
                <p:tabView>
                    <p:tab title="新增留存" id="newRemain">
                        <p:dataTable id="dlist2" var="l" value="#{bean.newRemainDatas}" scrollable="true"
                                     resizableColumns="true" paginator="true" paginatorPosition="top"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}"
                                     rowsPerPageTemplate="15,30,100" rows="15" style="text-align:center;">
                            <f:facet name="{Exporters}">
                                <h:commandLink styleClass="exporter">
                                    <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                                    <p:dataExporter type="xls" target="dlist2"
                                                    fileName="instanceStayActiveRadios-#{pageHelper.getNewDateDetailStr()}"/>
                                </h:commandLink>
                            </f:facet>
                            <p:column headerText="日期" styleClass="column grcvalidatedNewUser" sortBy="#{l.dateStr}">
                                <h:outputLabel value="#{l.dateStr}"/>
                            </p:column>
                            <p:column headerText="新增账号" styleClass="column grcvalidatedNewUser"
                                      sortBy="#{l.newAccount}">
                                <h:outputLabel value="#{l.newAccount}"/>
                            </p:column>
                            <p:column headerText="次日留存" styleClass="column grcnewUser" sortBy="#{l.remain2}">
                                <h:outputLabel value="#{l.remain2}"/>
                            </p:column>
                            <p:column headerText="3日留存" styleClass="column grcnewUser" sortBy="#{l.remain3}">
                                <h:outputLabel value="#{l.remain3}"/>
                            </p:column>
                            <p:column headerText="4日留存" styleClass="column grcnewUser" sortBy="#{l.remain4}">
                                <h:outputLabel value="#{l.remain4}"/>
                            </p:column>
                            <p:column headerText="5日留存" styleClass="column grcnewUser" sortBy="#{l.remain5}">
                                <h:outputLabel value="#{l.remain5}"/>
                            </p:column>
                            <p:column headerText="6日留存" styleClass="column grcnewUser" sortBy="#{l.remain6}">
                                <h:outputLabel value="#{l.remain6}"/>
                            </p:column>
                            <p:column headerText="7日留存" styleClass="column grcnewUser" sortBy="#{l.remain7}">
                                <h:outputLabel value="#{l.remain7}"/>
                            </p:column>
                            <p:column headerText="8日留存" styleClass="column grcnewUser" sortBy="#{l.remain8}">
                                <h:outputLabel value="#{l.remain8}"/>
                            </p:column>
                            <p:column headerText="9日留存" styleClass="column grcnewUser" sortBy="#{l.remain9}">
                                <h:outputLabel value="#{l.remain9}"/>
                            </p:column>
                            <p:column headerText="10日留存" styleClass="column grcnewUser" sortBy="#{l.remain10}">
                                <h:outputLabel value="#{l.remain10}"/>
                            </p:column>
                            <p:column headerText="11日留存" styleClass="column grcnewUser" sortBy="#{l.remain11}">
                                <h:outputLabel value="#{l.remain11}"/>
                            </p:column>
                            <p:column headerText="12日留存" styleClass="column grcnewUser" sortBy="#{l.remain12}">
                                <h:outputLabel value="#{l.remain12}"/>
                            </p:column>
                            <p:column headerText="13日留存" styleClass="column grcnewUser" sortBy="#{l.remain13}">
                                <h:outputLabel value="#{l.remain13}"/>
                            </p:column>
                            <p:column headerText="14日留存" styleClass="column grcnewUser" sortBy="#{l.remain14}">
                                <h:outputLabel value="#{l.remain14}"/>
                            </p:column>
                            <p:column headerText="15日留存" styleClass="column grcnewUser" sortBy="#{l.remain15}">
                                <h:outputLabel value="#{l.remain15}"/>
                            </p:column>
                            <p:column headerText="16日留存" styleClass="column grcnewUser" sortBy="#{l.remain16}">
                                <h:outputLabel value="#{l.remain16}"/>
                            </p:column>
                            <p:column headerText="17日留存" styleClass="column grcnewUser" sortBy="#{l.remain17}">
                                <h:outputLabel value="#{l.remain17}"/>
                            </p:column>
                            <p:column headerText="18日留存" styleClass="column grcnewUser" sortBy="#{l.remain18}">
                                <h:outputLabel value="#{l.remain18}"/>
                            </p:column>
                            <p:column headerText="19日留存" styleClass="column grcnewUser" sortBy="#{l.remain19}">
                                <h:outputLabel value="#{l.remain19}"/>
                            </p:column>
                            <p:column headerText="20日留存" styleClass="column grcnewUser" sortBy="#{l.remain20}">
                                <h:outputLabel value="#{l.remain20}"/>
                            </p:column>
                            <p:column headerText="21日留存" styleClass="column grcnewUser" sortBy="#{l.remain21}">
                                <h:outputLabel value="#{l.remain21}"/>
                            </p:column>
                            <p:column headerText="22日留存" styleClass="column grcnewUser" sortBy="#{l.remain22}">
                                <h:outputLabel value="#{l.remain22}"/>
                            </p:column>
                            <p:column headerText="23日留存" styleClass="column grcnewUser" sortBy="#{l.remain23}">
                                <h:outputLabel value="#{l.remain23}"/>
                            </p:column>
                            <p:column headerText="24日留存" styleClass="column grcnewUser" sortBy="#{l.remain24}">
                                <h:outputLabel value="#{l.remain24}"/>
                            </p:column>
                            <p:column headerText="25日留存" styleClass="column grcnewUser" sortBy="#{l.remain25}">
                                <h:outputLabel value="#{l.remain25}"/>
                            </p:column>
                            <p:column headerText="26日留存" styleClass="column grcnewUser" sortBy="#{l.remain26}">
                                <h:outputLabel value="#{l.remain26}"/>
                            </p:column>
                            <p:column headerText="27日留存" styleClass="column grcnewUser" sortBy="#{l.remain27}">
                                <h:outputLabel value="#{l.remain27}"/>
                            </p:column>
                            <p:column headerText="28日留存" styleClass="column grcnewUser" sortBy="#{l.remain28}">
                                <h:outputLabel value="#{l.remain28}"/>
                            </p:column>
                            <p:column headerText="29日留存" styleClass="column grcnewUser" sortBy="#{l.remain29}">
                                <h:outputLabel value="#{l.remain29}"/>
                            </p:column>
                            <p:column headerText="30日留存" styleClass="column grcnewUser" sortBy="#{l.remain30}">
                                <h:outputLabel value="#{l.remain30}"/>
                            </p:column>
                            <p:column headerText="60日留存" styleClass="column grcnewUser" sortBy="#{l.remain60}">
                                <h:outputLabel value="#{l.remain60}"/>
                            </p:column>
                            <p:column headerText="90日留存" styleClass="column grcnewUser" sortBy="#{l.remain90}">
                                <h:outputLabel value="#{l.remain90}"/>
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                    <p:tab title="累计付费" id="payTotal">
                        <p:dataTable id="dlist3" var="l" value="#{bean.totalPayDatas}" scrollable="true"
                                     resizableColumns="true" paginator="true" paginatorPosition="top"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}"
                                     rowsPerPageTemplate="15,30" rows="15" style="text-align:center;">
                            <f:facet name="{Exporters}">
                                <h:commandLink styleClass="exporter">
                                    <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                                    <p:dataExporter type="xls" target="dlist3"
                                                    fileName="instanceStayActiveRadios-#{pageHelper.getNewDateDetailStr()}"/>
                                </h:commandLink>
                            </f:facet>
                            <p:column headerText="日期" styleClass="column grcvalidatedNewUser" sortBy="#{l[0]}">
                                <h:outputLabel value="#{l[0]}"/>
                            </p:column>
                            <p:column headerText="新增账号" styleClass="column grcvalidatedNewUser" sortBy="#{l[5]}">
                                <h:outputLabel value="#{l[1]}"/>
                            </p:column>
                            <p:column headerText="1日收入" styleClass="column grcnewUser" sortBy="#{l[2]}">
                                <h:outputLabel value="#{l[2]}"/>
                            </p:column>
                            <p:column headerText="2日收入" styleClass="column grcnewUser" sortBy="#{l[3]}">
                                <h:outputLabel value="#{l[3]}"/>
                            </p:column>
                            <p:column headerText="3日收入" styleClass="column grcnewUser" sortBy="#{l[4]}">
                                <h:outputLabel value="#{l[4]}"/>
                            </p:column>
                            <p:column headerText="4日收入" styleClass="column grcnewUser" sortBy="#{l[5]}">
                                <h:outputLabel value="#{l[5]}"/>
                            </p:column>
                            <p:column headerText="5日收入" styleClass="column grcnewUser" sortBy="#{l[6]}">
                                <h:outputLabel value="#{l[6]}"/>
                            </p:column>
                            <p:column headerText="6日收入" styleClass="column grcnewUser" sortBy="#{l[7]}">
                                <h:outputLabel value="#{l[7]}"/>
                            </p:column>
                            <p:column headerText="7日收入" styleClass="column grcnewUser" sortBy="#{l[8]}">
                                <h:outputLabel value="#{l[8]}"/>
                            </p:column>
                            <p:column headerText="8日收入" styleClass="column grcnewUser" sortBy="#{l[9]}">
                                <h:outputLabel value="#{l[9]}"/>
                            </p:column>
                            <p:column headerText="9日收入" styleClass="column grcnewUser" sortBy="#{l[10]}">
                                <h:outputLabel value="#{l[10]}"/>
                            </p:column>
                            <p:column headerText="10日收入" styleClass="column grcnewUser" sortBy="#{l[11]}">
                                <h:outputLabel value="#{l[11]}"/>
                            </p:column>
                            <p:column headerText="11日收入" styleClass="column grcnewUser" sortBy="#{l[12]}">
                                <h:outputLabel value="#{l[12]}"/>
                            </p:column>
                            <p:column headerText="12日收入" styleClass="column grcnewUser" sortBy="#{l[13]}">
                                <h:outputLabel value="#{l[13]}"/>
                            </p:column>
                            <p:column headerText="13日收入" styleClass="column grcnewUser" sortBy="#{l[14]}">
                                <h:outputLabel value="#{l[14]}"/>
                            </p:column>
                            <p:column headerText="14日收入" styleClass="column grcnewUser" sortBy="#{l[15]}">
                                <h:outputLabel value="#{l[15]}"/>
                            </p:column>
                            <p:column headerText="15日收入" tyleClass="column grcnewUser" sortBy="#{l[16]}">
                                <h:outputLabel value="#{l[16]}"/>
                            </p:column>
                            <p:column headerText="16日收入" styleClass="column grcnewUser" sortBy="#{l[17]}">
                                <h:outputLabel value="#{l[17]}"/>
                            </p:column>
                            <p:column headerText="17日收入" styleClass="column grcnewUser" sortBy="#{l[18]}">
                                <h:outputLabel value="#{l[18]}"/>
                            </p:column>
                            <p:column headerText="18日收入" styleClass="column grcnewUser" sortBy="#{l[19]}">
                                <h:outputLabel value="#{l[19]}"/>
                            </p:column>
                            <p:column headerText="19日收入" styleClass="column grcnewUser" sortBy="#{l[20]}">
                                <h:outputLabel value="#{l[20]}"/>
                            </p:column>
                            <p:column headerText="20日收入" styleClass="column grcnewUser" sortBy="#{l[21]}">
                                <h:outputLabel value="#{l[21]}"/>
                            </p:column>
                            <p:column headerText="21日收入" styleClass="column grcnewUser" sortBy="#{l[22]}">
                                <h:outputLabel value="#{l[22]}"/>
                            </p:column>
                            <p:column headerText="22日收入" styleClass="column grcnewUser" sortBy="#{l[23]}">
                                <h:outputLabel value="#{l[23]}"/>
                            </p:column>
                            <p:column headerText="23日收入" styleClass="column grcnewUser" sortBy="#{l[24]}">
                                <h:outputLabel value="#{l[24]}"/>
                            </p:column>
                            <p:column headerText="24日收入" styleClass="column grcnewUser" sortBy="#{l[25]}">
                                <h:outputLabel value="#{l[25]}"/>
                            </p:column>
                            <p:column headerText="25日收入" styleClass="column grcnewUser" sortBy="#{l[26]}">
                                <h:outputLabel value="#{l[26]}"/>
                            </p:column>
                            <p:column headerText="26日收入" styleClass="column grcnewUser" sortBy="#{l[27]}">
                                <h:outputLabel value="#{l[27]}"/>
                            </p:column>
                            <p:column headerText="27日收入" styleClass="column grcnewUser" sortBy="#{l[28]}">
                                <h:outputLabel value="#{l[28]}"/>
                            </p:column>
                            <p:column headerText="28日收入" styleClass="column grcnewUser" sortBy="#{l[29]}">
                                <h:outputLabel value="#{l[29]}"/>
                            </p:column>
                            <p:column headerText="29日收入" styleClass="column grcnewUser" sortBy="#{l[30]}">
                                <h:outputLabel value="#{l[30]}"/>
                            </p:column>
                            <p:column headerText="30日收入" styleClass="column grcnewUser" sortBy="#{l[31]}">
                                <h:outputLabel value="#{l[31]}"/>
                            </p:column>
                            <p:column headerText="31日收入" styleClass="column grcnewUser" sortBy="#{l[32]}">
                                <h:outputLabel value="#{l[32]}"/>
                            </p:column>
                            <p:column headerText="32日收入" styleClass="column grcnewUser" sortBy="#{l[33]}">
                                <h:outputLabel value="#{l[33]}"/>
                            </p:column>
                            <p:column headerText="33日收入" styleClass="column grcnewUser" sortBy="#{l[34]}">
                                <h:outputLabel value="#{l[34]}"/>
                            </p:column>
                            <p:column headerText="34日收入" styleClass="column grcnewUser" sortBy="#{l[35]}">
                                <h:outputLabel value="#{l[35]}"/>
                            </p:column>
                            <p:column headerText="35日收入" styleClass="column grcnewUser" sortBy="#{l[36]}">
                                <h:outputLabel value="#{l[36]}"/>
                            </p:column>
                            <p:column headerText="36日收入" styleClass="column grcnewUser" sortBy="#{l[37]}">
                                <h:outputLabel value="#{l[37]}"/>
                            </p:column>
                            <p:column headerText="37日收入" styleClass="column grcnewUser" sortBy="#{l[38]}">
                                <h:outputLabel value="#{l[38]}"/>
                            </p:column>
                            <p:column headerText="38日收入" styleClass="column grcnewUser" sortBy="#{l[39]}">
                                <h:outputLabel value="#{l[39]}"/>
                            </p:column>
                            <p:column headerText="39日收入" styleClass="column grcnewUser" sortBy="#{l[40]}">
                                <h:outputLabel value="#{l[40]}"/>
                            </p:column>
                            <p:column headerText="40日收入" styleClass="column grcnewUser" sortBy="#{l[41]}">
                                <h:outputLabel value="#{l[41]}"/>
                            </p:column>
                            <p:column headerText="41日收入" styleClass="column grcnewUser" sortBy="#{l[42]}">
                                <h:outputLabel value="#{l[42]}"/>
                            </p:column>
                            <p:column headerText="42日收入" styleClass="column grcnewUser" sortBy="#{l[43]}">
                                <h:outputLabel value="#{l[43]}"/>
                            </p:column>
                            <p:column headerText="43日收入" styleClass="column grcnewUser" sortBy="#{l[44]}">
                                <h:outputLabel value="#{l[44]}"/>
                            </p:column>
                            <p:column headerText="44日收入" styleClass="column grcnewUser" sortBy="#{l[45]}">
                                <h:outputLabel value="#{l[45]}"/>
                            </p:column>
                            <p:column headerText="45日收入" styleClass="column grcnewUser" sortBy="#{l[46]}">
                                <h:outputLabel value="#{l[46]}"/>
                            </p:column>
                            <p:column headerText="46日收入" styleClass="column grcnewUser" sortBy="#{l[47]}">
                                <h:outputLabel value="#{l[47]}"/>
                            </p:column>
                            <p:column headerText="47日收入" styleClass="column grcnewUser" sortBy="#{l[48]}">
                                <h:outputLabel value="#{l[48]}"/>
                            </p:column>
                            <p:column headerText="48日收入" styleClass="column grcnewUser" sortBy="#{l[49]}">
                                <h:outputLabel value="#{l[49]}"/>
                            </p:column>
                            <p:column headerText="49日收入" styleClass="column grcnewUser" sortBy="#{l[50]}">
                                <h:outputLabel value="#{l[50]}"/>
                            </p:column>
                            <p:column headerText="50日收入" styleClass="column grcnewUser" sortBy="#{l[51]}">
                                <h:outputLabel value="#{l[51]}"/>
                            </p:column>
                            <p:column headerText="51日收入" styleClass="column grcnewUser" sortBy="#{l[52]}">
                                <h:outputLabel value="#{l[52]}"/>
                            </p:column>
                            <p:column headerText="52日收入" styleClass="column grcnewUser" sortBy="#{l[53]}">
                                <h:outputLabel value="#{l[53]}"/>
                            </p:column>
                            <p:column headerText="53日收入" styleClass="column grcnewUser" sortBy="#{l[54]}">
                                <h:outputLabel value="#{l[54]}"/>
                            </p:column>
                            <p:column headerText="54日收入" styleClass="column grcnewUser" sortBy="#{l[55]}">
                                <h:outputLabel value="#{l[55]}"/>
                            </p:column>
                            <p:column headerText="55日收入" styleClass="column grcnewUser" sortBy="#{l[56]}">
                                <h:outputLabel value="#{l[56]}"/>
                            </p:column>
                            <p:column headerText="56日收入" styleClass="column grcnewUser" sortBy="#{l[57]}">
                                <h:outputLabel value="#{l[57]}"/>
                            </p:column>
                            <p:column headerText="57日收入" styleClass="column grcnewUser" sortBy="#{l[58]}">
                                <h:outputLabel value="#{l[58]}"/>
                            </p:column>
                            <p:column headerText="58日收入" styleClass="column grcnewUser" sortBy="#{l[59]}">
                                <h:outputLabel value="#{l[59]}"/>
                            </p:column>
                            <p:column headerText="59日收入" styleClass="column grcnewUser" sortBy="#{l[60]}">
                                <h:outputLabel value="#{l[60]}"/>
                            </p:column>
                            <p:column headerText="60日收入" styleClass="column grcnewUser" sortBy="#{l[61]}">
                                <h:outputLabel value="#{l[61]}"/>
                            </p:column>
                            <p:column headerText="90日收入" styleClass="column grcnewUser" sortBy="#{l[91]}">
                                <h:outputLabel value="#{l[91]}"/>
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                </p:tabView>
            </p:panel>
        </div>
    </h:form>
    <!-- 页脚 -->
    <div class="footer"></div>
</h:body>
</html>